package entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.NamedNativeQueries;
import javax.persistence.NamedNativeQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


@NamedNativeQueries({	
	@NamedNativeQuery(name="getUsuario", query = "select * from usuario "
												+ "where login = :login ", resultClass = UsuarioENT.class)	
})


@Entity
@Table(name="usuario")
public class UsuarioENT implements Serializable{
/*------------------------------------------------------------------------------------*/
	private static final long serialVersionUID = -949238581848114021L;
	
	@Id
	@GeneratedValue
	private int id;
	
	
	@Column(name = "login",unique=true, nullable = false)
	private String login;
	
	@Column(name="password",nullable = false)
	private String password;	
	
	@Column(name="nome",nullable = false)
	private String nome;	
	
	@Column(name="email",nullable = false)
	private String email;
	
	@Column(name="data_alteracao",nullable = false)
	@Temporal(TemporalType.TIMESTAMP)	
	private Date dtAlteracao;
/*------------------------------------------------------------------------------------*/	
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getLogin() {
		return login;
	}

	public void setLogin(String login) {
		this.login = login;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getNome() {
		return nome;
	}

	public void setNome(String nome) {
		this.nome = nome;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public Date getDtAlteracao() {
		return dtAlteracao;
	}

	public void setDtAlteracao(Date dtAlteracao) {
		this.dtAlteracao = dtAlteracao;
	}
	
	public UsuarioENT() {
		// TODO Auto-generated constructor stub
	}

}
